package com.code.common.model;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: Yan
 * @date: 2023/03/29
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ResponseCode implements ErrorCode {

    SUCCESS("C10001", "操作成功"),
    ERROR("C10002", "操作失败"),
    SERVER_ERROR("C10003", "服务器出错了o(╥﹏╥)o"),
    OPERATION_FREQUENT("C10005", "操作频繁，请稍后尝试"),
    TOKEN_EXPIRED("C10006", "token过期，请重新登录"),
    NO_ACCESS("C10007", "抱歉，您没有访问权限"),

    VERIFY_CODE_NOT_EMPTY("C11001", "验证码不能为空"),
    VERIFY_CODE_EXPIRED("C11002", "验证码过期，请重新获取"),
    VERIFY_CODE_ERROR("C11003", "验证码错误"),
    MOBILE_NOT_LEGAL("C11004", "手机号码格式错误"),
    UNAUTHORIZED("C11005", "访问权限不足"),
    USERNAME_PASSWORD_ERROR("C11006", "账号密码错误"),
    USER_LOGIN_FAILURE("C11007", "登录失败"),
    USER_ACCOUNT_NOT_EXIST("C11008", "账号未注册"),
    USER_ACCOUNT_ALREADY_EXIST("C11009", "账号已注册"),
    USER_ACCOUNT_LOCKED("C11010", "账户被锁定，请联系客服"),
    USER_ACCOUNT_DISABLE("C11011", "账户违规禁用，请联系客服")
    ;

    private String code;
    private String msg;

    ResponseCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
